package com.ler.yrmall.coupon.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ler.yrmall.coupon.mapper.MemberPriceMapper;
import com.ler.yrmall.coupon.entity.MemberPriceEntity;
import com.ler.yrmall.coupon.service.MemberPriceService;
import com.ler.yrmall.coupon.vo.MemberPriceVO;
import com.ler.yrmall.basic.Form;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;


/**
 * @author leron
 */
@Service
public class MemberPriceServiceImpl extends ServiceImpl<MemberPriceMapper, MemberPriceEntity> implements MemberPriceService {

    @Override
    public IPage<MemberPriceVO> queryPage(Form request) {
        IPage<MemberPriceEntity> page = this.page(request.getPage());
        return page.convert(item -> {
            MemberPriceVO target = new MemberPriceVO();
            BeanUtils.copyProperties(item,target);
            return target;
        });
    }

}